﻿namespace ZFramework.Runtime
{
    public delegate void UnloadSceneSuccessCallback(string assetName, object userData);

    public delegate void UnloadSceneFailureCallback(string assetName, object userData);

    public class UnloadSceneCallbacks
    {
        private readonly UnloadSceneSuccessCallback _unloadSceneSuccessCallback;
        private readonly UnloadSceneFailureCallback _unloadSceneFailureCallback;

        public UnloadSceneCallbacks(UnloadSceneSuccessCallback unloadSceneSuccessCallback)
            : this(unloadSceneSuccessCallback, null)
        {
        }

        public UnloadSceneCallbacks(UnloadSceneSuccessCallback unloadSceneSuccessCallback,
            UnloadSceneFailureCallback unloadSceneFailureCallback)
        {
            _unloadSceneSuccessCallback = unloadSceneSuccessCallback;
            _unloadSceneFailureCallback = unloadSceneFailureCallback;
        }

        public UnloadSceneSuccessCallback UnloadSceneSuccessCallback
        {
            get { return _unloadSceneSuccessCallback; }
        }

        /// <summary>
        /// 获取加载资源失败回调函数。
        /// </summary>
        public UnloadSceneFailureCallback UnloadSceneFailureCallback
        {
            get { return _unloadSceneFailureCallback; }
        }
    }
}
